package main

import "fmt"

func printArray(myArray []int) {
	// 引用传递
	// _ 表示匿名的变量
	for _, value := range myArray {
		fmt.Println("value = ", value)
	}

	myArray[0] = 100
}

func main() {
	myArray := []int{1, 2, 3, 4} // 动态数组，切片 slice
	arr := []int{23, 3, 3, 3, 3, 3, 2, 4, 3, 4, 5}
	fmt.Printf("myArray type is %T\n", myArray)

	printArray(myArray)

	fmt.Println(" ==== ")

	for _, value := range myArray {
		fmt.Println("value = ", value)
	}
	fmt.Println("------------ for res := range arr{ -----------")
	for _, res := range arr {
		fmt.Print(" ", res)
	}
}
